﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

[Serializable]
public class InitItem
{
    public long id;
    public string name;
    /// <summary>
    /// 品质
    /// </summary>
    public int quality;
    /// <summary>
    /// 信息
    /// </summary>
    public string info;
    /// <summary>
    /// 是否能使用
    /// </summary>
    public bool is_use;
    /// <summary>
    /// 是否能出售
    /// </summary>
    public bool is_sale;
    /// <summary>
    /// 获取途径描述
    /// </summary>
    public string source;
}

public class InitItemMgr
{
    public static Dictionary<long, InitItem> Dict { get; private set; }

    public static void Load()
    {
        List<InitItem> initRoles = StaticDataReader.LoadJsonFromFile<InitItem>("static_init_item");
        if (initRoles != null)
        {
            Dict = new Dictionary<long, InitItem>(initRoles.Count);
            for(int i=0; i<initRoles.Count; i++)
            {
                Dict.Add(initRoles[i].id, initRoles[i]);
            }
        }
        else
        {
            Dict = new Dictionary<long, InitItem>();
        }
    }
}
